import { Directive } from "../type";
import permissionStore from "@/store/modules/permission";
export default {
  name: "btnAuth",
  install: {
    // vnode: Directive.Vnode, prevVnode: Directive.Vnode
    mounted(el: Element, binding: Directive.Binding, vnode: any) {
      const { value } = binding;
      const permissionMap = permissionStore.btnAuth || [];
      if (!permissionMap.includes(value)) {
        el && ((el as any).style = "display: none");
      }
    }
  }
};
